package com.hspedu.codeblock;

//输出什么
public class CodeBlockExercise02 {
    Sample sam1= new Sample("sam1成员初始化");
    static Sample sam = new Sample("静态成员sam初始化");
    static{
        System.out.println("static块被执行");
        if (sam == null ) System.out.println("sam is null");
    }
    CodeBlockExercise02(){
        System.out.println("CodeBlockExercise02默认构造函数被调用");
    }

    public static void main(String[] args) {
        CodeBlockExercise02 codeBlockExercise02 = new CodeBlockExercise02();
    }
}
class Sample{
    Sample(String s){
        System.out.println(s);
    }
    Sample(){
        System.out.println("Sample默认构造器");
    }
}